<% label_title = Alchemy.t("Create #{resource_name}", default: Alchemy.t('Create')) %>

<% content_for(:toolbar) do %>
  <div class="toolbar_buttons">
    <%= render Alchemy::Admin::ToolbarButton.new(
      icon: "add",
      label: label_title,
      url: new_resource_path,
      title: label_title,
      hotkey: 'alt+n',
      tooltip_placement: "top-start",
      dialog_options: {
        title: label_title,
        size: resource_window_size
      },
      if_permitted_to: [:create, resource_model]
    ) %>
    <%= render Alchemy::Admin::ToolbarButton.new(
      icon: :download,
      url: resource_url_proxy.url_for(action: 'index', format: 'csv', **search_filter_params),
      label: Alchemy.t(:download_csv),
      title: Alchemy.t(:download_csv),
      dialog: false,
      if_permitted_to: [:index, resource_model]
    ) %>
  </div>
  <%= render 'alchemy/admin/partials/search_form' %>
<% end %>

<div id="archive_all" class="resources-table-wrapper<%= ' with_tag_filter' if resource_has_tags || resource_has_filters %>">
  <%= render 'alchemy/admin/resources/table_header' %>
  <%= render 'resource_table' %>

  <% if resource_has_tags || resource_has_filters %>
    <div id="library_sidebar">
      <%= render 'filter_bar' if resource_has_filters %>
      <%= render 'tag_list' if resource_has_tags %>
    </div>
  <% end %>
</div>
